(ns script.startup
 (:use wrapper.ewrapperimpl)
 (:use tws.client.twsclient)
 (:use constants.constants)
  ;"require should come before import for def record imports"
  (:import [wrapper.ewrapperimpl Ewrapperimpl])

  (:use [clojure.tools.logging :only (info error)])
  (:use [clojure.java.shell :only (sh)])
  )

;start tws
; started from bash shell
(. Thread (sleep 60000))

; connect tws
(def connObj (connect (Ewrapperimpl.) "localhost" 7496 4))

(def sampleContractTotest (make-contract "BAC" "STK" "SMART" "" "" "" "" "USD"))

(request-market-data connObj 1 sampleContractTotest  "221")



;(info "tws queue...while true")
;(while true 
;  (def message (.take twsqueue))
;  (info "message" message)
;  )

; create hazelcast
